package com.erp.erp_servers.warehouse.imp;

import com.erp.erp_dao.warehouse.IOtherOutStockDao;
import com.erp.erp_entitys.warehouse.entity.OtherOutStockEntity;
import com.erp.erp_entitys.warehouse.req.CustomerInfoReq;
import com.erp.erp_entitys.warehouse.req.CustomerQueryReq;
import com.erp.erp_entitys.warehouse.req.OtherOutStockListByPageReq;
import com.erp.erp_entitys.warehouse.rsp.*;
import com.erp.erp_servers.warehouse.IOtherOutStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : OtherOutStockServiceImp
 * @Description : 其它出库实现类
 * @Author : lst
 * @Date: 2020-07-29 12:11
 */
@Service
public class OtherOutStockServiceImp implements IOtherOutStockService {

    /**
     * 其它出库接口
     */
    private final IOtherOutStockDao otherOutStockDao;


    @Autowired
    public OtherOutStockServiceImp(IOtherOutStockDao otherOutStockDao) {
        this.otherOutStockDao = otherOutStockDao;
    }


    /**
     * 通过id查询其他出库信息
     * @param id id
     * @return 其它出库对象
     */
    @Override
    public OtherOutStockEntity queryById(Integer id) {
        return otherOutStockDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param otherOutStock 实例对象
     * @return 对象列表
     */
    @Override
    public List<OtherOutStockEntity> queryAll(OtherOutStockEntity otherOutStock) {
        return otherOutStockDao.queryAll(otherOutStock);
    }

    /**
     * 获取出库信息
     * @param req 出库参数
     * @return 出库信息
     */
    @Override
    public List<OtherOutStockEntity> getListByPage(OtherOutStockListByPageReq req) {
        return otherOutStockDao.getListByPage(req);
    }

    /**
     * 新增数据
     *
     * @param otherOutStock 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(OtherOutStockEntity otherOutStock) {
        return otherOutStockDao.insert(otherOutStock);
    }

    /**
     * 修改数据
     *
     * @param otherOutStock 实例对象
     * @return 影响行数
     */
    @Override
    public int update(OtherOutStockEntity otherOutStock) {
        return otherOutStockDao.update(otherOutStock);
    }


    //**************************************客户信息表***************************************************

    /**
     * 获取客户所有信息
     * @param limitSize 查询条数
     * @param info 查询条件
     * @param userCode 用户编码
     * @return 客户所有信息
     */
    @Override
    public List<CustomerInfoRsp> getCustomerAllInfo(Integer limitSize, String info, String userCode) {
        return otherOutStockDao.getCustomerAllInfo(limitSize, info, userCode);
    }

    /**
     * 获取客户信息
     * @param req 查询对象
     * @return 客户信息
     */
    @Override
    public List<CustomerInfoRsp> getCustomerInfo(CustomerInfoReq req) {
        return otherOutStockDao.getCustomerInfo(req);
    }

    /**
     * 获取客户信息
     * @param code 客户编码
     * @return 客户信息
     */
    @Override
    public CustomerInfoRsp getCustomerByCode(String code) {
        return otherOutStockDao.getCustomerByCode(code);
    }

    /**
     * 通过条件获取客户信息
     * @param req 查询条件实体
     * @return 客户信息
     */
    @Override
    public List<CustomerInfoDataRsp> getCustomerByQuery(CustomerQueryReq req) {
        return otherOutStockDao.getCustomerByQuery(req);
    }


    //**************************************客户联系人***************************************************

    /**
     * 通过客户编码获取客户联系人信息
     * @param customCode 客户编码
     * @return 客户联系人
     */
    @Override
    public List<CustomerContactRsp> getCustomerContactInfo(String customCode) {
        return otherOutStockDao.getCustomerContactInfo(customCode);
    }

    /**
     * 根据客户编码获取客户联系人信息
     * @param req 客户编码
     * @return 客户联系人信息
     */
    @Override
    public List<CustomerContactInfoDataRsp> getCustomerContactInfoByCode(CustomerInfoReq req) {
        return otherOutStockDao.getCustomerContactInfoByCode(req);
    }


    //**************************************用户信息表*************************************************

    /**
     * 获取所有用户信息
     * @return 用户信息
     */
    @Override
    public List<UserInfoRsp> getAllUserInfo() {
        return otherOutStockDao.getAllUserInfo();
    }


}
